
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;

namespace VatTuDAO
{

    public static class ConfigDataProvider
    {

        private static string _dbConnectionString;
        private static string _dbProviderName;

        public static void getConfigDataProvider()
        {
            string database = ConfigurationManager.AppSettings["Database"];
            string host = ConfigurationManager.AppSettings["Host"];
            string username = ConfigurationManager.AppSettings["Username"];
            string pass = ConfigurationManager.AppSettings["Password"];

            _dbConnectionString = "Database=" + database + ";Data Source=" + host + ";User Id=" + username + ";Password=" + pass + ";charset=utf8";

            _dbProviderName = ConfigurationManager.AppSettings["ProviderName"];
        }

        public static string DbConnectionString
        {
            get
            {
                return _dbConnectionString;
            }
        }

        public static bool EnableErrorLog
        {
            get
            {
                return bool.Parse(ConfigurationManager.AppSettings["EnableErrorLog"]);
            }
        }

        public static string DbProviderName
        {
            get
            {
                return _dbProviderName;
            }
        }

        public static bool ErrorLogFile
        {
            get
            {
                return bool.Parse(ConfigurationManager.AppSettings["ErrorLogFile"]);
            }
        }
    }
}
